#ifndef MAINUIPLUGININTERFACE_H
#define MAINUIPLUGININTERFACE_H

//Qt
#include <QtWidgets/QActionGroup>
#include <QtWidgets/QWidget>

#include "DefaultPluginInterface.h"
#include "MainAppInterface.h"


class MainAppInterface;


//! Standard CC plugin interface
/** Version 1.5
    The plugin is now responsible for its own actions (QAction ;)
    and the associated ccMainAppInterface member should give it
    access to everything it needs in the main application.
**/
class  MainuiPluginInterface : public DefaultPluginInterface
{
public:

    //! Default constructor
    MainuiPluginInterface( const QString &resourcePath = QString() ) :
        DefaultPluginInterface( resourcePath )
      , m_app(nullptr)
    {
    }

    //! Destructor
    ~MainuiPluginInterface() override = default;

    //inherited from ccPluginInterface
    PLUGIN_TYPE getType() const override { return MAIN_UI_PLUGIN; }

    //! Sets application entry point
    /** Called just after plugin creation by qCC
    **/
    virtual void setMainAppInterface(MainAppInterface* app)
    {
        m_app = app;

        if (m_app)
        {
            //we use the same 'unique ID' generator in plugins as in the main
            //application (otherwise we'll have issues with 'unique IDs'!)

        }
    }

    //! A callback pointer to the main app interface for use by plugins
    /**  Any plugin (and its tools) may need to access methods of this interface
    **/
    virtual MainAppInterface * getMainAppInterface() { return m_app; }

    //! Get a list of actions for this plugin
//	virtual QList<QAction *> getActions() = 0;

    virtual QMap<QString,QList<QAction *>> getActions()=0;
    virtual QString getCatogry()=0;
    virtual QList<QWidget *> getWidgets() =0;


    //! This method is called by the main application whenever the entity selection changes
    /** Does nothing by default. Should be re-implemented by the plugin if necessary.
        \param selectedEntities currently selected entities
    **/

protected:

    //! Main application interface
    MainAppInterface* m_app;
};

Q_DECLARE_METATYPE(const MainuiPluginInterface *);

Q_DECLARE_INTERFACE(MainuiPluginInterface,"edf.rd.MainuiPluginInterface/1.4")


















#endif // MAINUIPLUGININTERFACE_H
